﻿using System;
using SolrNet.Attributes;

namespace Sherwood.Content.UpdateServices.Solr
{
    /// <summary>
    /// A search document that may be used as a base class in a real world application.
    /// </summary>
    public class SolrDocument : ISearchDocument
    {
        public Guid RecordId
        {
            get { return Guid.Parse(Id); }
            set { Id = value.ToString(); }
        }

        [SolrUniqueKey("source")]
        public string Source { get; set; }

        [SolrUniqueKey("id")]
        public string Id { get; set; }

        [SolrField("title")]
        public string Title { get; set; }

        [SolrField("description")]
        public string Description { get; set; }

        [SolrField("culture")]
        public string CultureName { get; set; }

        [SolrField("culture_invariant_id")]
        public string CultureInvariantReferenceId { get; set; }

        [SolrField("language")]
        public string LanguageCode { get; set; }
    }
}